home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 October: Mac OS SDK / Dev.CD Oct 00 SDK1.toast / Development Kits / Cross Platform / QuickTime 4.1.2 Windows SDK / RIncludes / InputSprocket.r < prev    next >
Encoding:
Text File  |  2000-04-12  |  6.4 KB  |  177 lines  |  [TEXT/R*ch]

  1. /*
  2.      File:        InputSprocket.r
  3.  
  4.      Contains:    Games Sprockets: InputSprocket interfaaces
  5.  
  6.      Version:    Technology:    InputSprocket 1.7
  7.                  Release:    QuickTime 4.1
  8.  
  9.      Copyright:    © 1996-1999 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17.  
  18. #ifndef __INPUTSPROCKET_R__
  19. #define __INPUTSPROCKET_R__
  20.  
  21. #ifndef __CONDITIONALMACROS_R__
  22. #include "ConditionalMacros.r"
  23. #endif
  24.  
  25. #define kISpDeviceClass_SpeechRecognition  'talk'
  26. #define kISpDeviceClass_Mouse             'mous'
  27. #define kISpDeviceClass_Keyboard         'keyd'
  28. #define kISpDeviceClass_Joystick         'joys'
  29. #define kISpDeviceClass_Gamepad         'gmpd'
  30. #define kISpDeviceClass_Wheel             'whel'
  31. #define kISpDeviceClass_Pedals             'pedl'
  32. #define kISpDeviceClass_Levers             'levr'
  33. #define kISpDeviceClass_Tickle             'tckl'                /*  a device of this class requires ISpTickle */
  34. #define kISpDeviceClass_Unknown         '????'
  35.  
  36. #define kISpKeyboardID_Apple             'appl'                /*  currently this applies to _all_ keyboards */
  37.  
  38. /*    Rez interfaces for InputSprocket.
  39.  *
  40.  *    Specifically, this file is intended to make the development process 
  41.  *    easier. Now the default keyboard settings can be specified in a rez
  42.  *    file which should be easy to modify when new needs are added and/or
  43.  *    the order of needs are changed.
  44.  *    
  45.  *    Note: When the ISp keyboard driver undergoes a major revision, it will
  46.  *    almost certainly use a newer format to store it's settings. It will,
  47.  *    however, continue to be able to read this format, but it will no longer
  48.  *    write it.
  49.  *    
  50.  *    Currently, only a template is provided for keyboard settings, since
  51.  *    keyboard is the one that is the most difficult to recreate, and since
  52.  *    each driver uses a private format for its settings. For all other 
  53.  *    devices, you should continue to include the 'tset' resources copied
  54.  *    from your prefs file. Make sure you include references to them in
  55.  *     the set list resource ('setl').
  56.  *
  57.  *    The 'setl' resource contains a length value of the 'tset' is refers to.
  58.  *    This obviously won't do for use in Rez, so ISp 1.3 and later has been
  59.  *    modified to allow a zero value (in which case, it cannot check to
  60.  *    verify that it is the correct length.) Because of this change:
  61.  *    applications that use this template will _require_ InputSprocket 1.3
  62.  *    or later... you have been warned.
  63.  *
  64.  */
  65.  
  66.  
  67. /*----------------------------isap • InputSprocket application resource ----------------*/
  68. type 'isap'
  69. {
  70.         flags:
  71.             fill bit[24];
  72.             fill bit[6];
  73.             boolean        doesNotCallISpInit, callsISpInit;                
  74.             boolean        notUseInputSprocket, usesInputSprocket;
  75.  
  76.         fill long[3];
  77. };
  78.  
  79.  
  80. /*----------------------------setl • a set list resource -------------------------------*/
  81. type 'setl'
  82. {
  83.     unsigned longint    currentVersion = 2;
  84.     
  85.     unsigned longint = $$Countof(Needs);
  86.     array Needs
  87.     {
  88.         pstring[63];                                        /* the name of the set */
  89.         unsigned longint length;                            /* the length of the set */
  90.         literal longint    deviceClass;                        /* the device class for the set */
  91.         literal longint    deviceIdentifier;                    /* the device identifier for the set */
  92.     
  93.         flags:
  94.             fill bit[24];
  95.             fill bit[3];
  96.             fill bit;                                        /* set from custom (not supported) */
  97.             fill bit;                                        /* set from driver (not supported) */
  98.             boolean        notApplSet, isApplSet;                /* true if the set is from application and not a default */
  99.             boolean        notDefaultSet, isDefaultSet;        /* true if this is the default for its device */
  100.             fill bit;
  101.         
  102.         fill long[3];
  103.         integer    resourceID;                                    /* the resource ID of the set */
  104.         fill word;
  105.     };
  106. };
  107.  
  108.  
  109.  
  110. /*----------------------------tset • a saved set ---------------------------------------*/
  111. /*----------------------------only valid for keyboard tsets ----------------------------*/
  112. type 'tset'
  113. {
  114.     unsigned longint    supportedVersion = 1;
  115.     
  116.     unsigned longint = $$Countof(ExpandedNeeds);
  117.     wide array ExpandedNeeds
  118.     {
  119. keyCode:
  120.         unsigned hex integer noKey = 0x8000,                /* virtual key code        */
  121.             /* NOTE: names of keys refer to the Apple Extended English Keyboard         */
  122.             /* Non-english keyboards have slightly different keycodes                */
  123.             /* In all cases, the actual virtual key code is stored for that device    */
  124.             tildeKey = 0x0032, n1Key = 0x0012, n2Key = 0x0013, n3Key = 0x0014, n4Key = 0x0015,
  125.             n5Key = 0x0017, n6Key = 0x0016, n7Key = 0x001A, n8Key = 0x001C, n9Key = 0x0019,
  126.             n0Key = 0x001D, minusKey = 0x001B, plusKey = 0x0018, deleteKey = 0x0033,
  127.             
  128.             tabKey = 0x0030, qKey = 0x000c, wKey = 0x000D, eKey = 0x000E, rKey = 0x000F, 
  129.             tKey = 0x0011, yKey = 0x0010, uKey = 0x0020, iKey = 0x0022, oKey = 0x001F,
  130.             pKey = 0x0023, lBraceKey = 0x0021, rBraceKey = 0x001E, backslashKey = 0x002A,
  131.             
  132.             capsKey = 0x0039, aKey = 0x0000, sKey = 0x0001, dKey = 0x0002, fKey = 0x0003, 
  133.             gKey = 0x0005, hKey = 0x0004, jKey = 0x0026, kKey = 0x0028, lKey = 0x0025, 
  134.             colonKey = 0x0029, quoteKey = 0x0027, returnKey = 0x0024,
  135.             
  136.             shiftKey = 0x0038, zKey = 0x0006, xKey = 0x0007, cKey = 0x0008, vKey = 0x0009,
  137.             bKey = 0x0001,  nKey = 0x002D, mKey = 0x002E, lessThanKey = 0x002B, 
  138.             greaterThanKey = 0x002F, slashKey = 0x002C,
  139.             
  140.             controlKey = 0x003B, optionKey = 0x003A, commandKey = 0x0037, spaceKey = 0x0031,
  141.             rShiftKey = 0x003C, rOptionKey = 0x003D, rControlKey = 0x003E, 
  142.  
  143.         
  144.             escKey = 0x0035, f1Key = 0x007a, f2Key = 0x0078, f3Key = 0x0063, f4Key = 0x0076,
  145.             f5Key = 0x0060, f6Key = 0x0061, f7Key = 0x0062, f8Key = 0x0064,
  146.             f9Key = 0x0065, f10Key = 0x006D, f11Key = 0x0067, f12Key = 0x006F, 
  147.             f13Key = 0x0069, f14Key = 0x006B, f15Key = 0x0071,
  148.             
  149.             helpKey = 0x0072, homeKey = 0x0073, pageUpKey = 0x0074,
  150.             delKey = 0x0075, endKey = 0x0077, pageDownKey = 0x0079
  151.             
  152.             upKey = 0x007E, leftKey = 0x007B, downKey = 0x007D, rightKey = 0x007C,
  153.             
  154.             kdpClearKey = 0x0047, kpdEqualKey = 0x0051, kpdSlashKey = 0x004B, kpdStarKey = 0x0043,
  155.             kpd7Key = 0x0059, kpd8Key = 0x005B, kpd9Key = 0x005C, kpdMinusKey = 0x004E,
  156.             kpd4Key = 0x0056, kpd5Key = 0x0057, kpd6Key = 0x0058, kpdPlusKey = 0x0045,
  157.             kpd1Key = 0x0053, kpd2Key = 0x0054, kpd3Key = 0x0055, kpdEnterKey = 0x004C,
  158.             kpd0Key = 0x0052, kpdDecimalKey = 0x0041;
  159.         
  160.         /* Modifiers required to be down */
  161.         boolean        rControlOff, rControlOn;
  162.         boolean        rOptionOff, rOptionOn;
  163.         boolean        rShiftOff, rShiftOn;
  164.         boolean        controlOff, controlOn;
  165.         boolean        optionOff, optionOn;
  166.         fill bit;                                            /* capsLockOff, capsLockOn*/
  167.         boolean        shiftOff, shiftOn;
  168.         boolean        commandOff, commandOn;
  169.  
  170.         fill byte;                                            
  171.     };
  172. };
  173.  
  174.  
  175. #endif /* __INPUTSPROCKET_R__ */
  176.  
  177.